﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace MobileControlGuru.AutoTask
{
    public partial class CommentControl : UserControl
    {
        public delegate void DeleteComment(int index);
        public int Index;
        public DeleteComment deleteCommentEevnt { get; set; }
        public ReferenceSource _sourceItem;
        public CommentControl()
        {
            InitializeComponent();
        }
        public CommentControl(ReferenceSource sourceItem)
        {
            InitializeComponent();
            if (sourceItem != null)
            {
                _sourceItem = sourceItem;

                this.inputComment.Text = sourceItem.RContent;
            }
           
        }
        public void SetIndex(int index)
        {
            Index = index;
            //this.label1.Text = "操作：" + index.ToString();
        }
        private void buttonDel_Click(object sender, EventArgs e)
        {
            deleteCommentEevnt(Index);
            this.Dispose();
        }
    }
}
